/**
 * Created by chenz2 on 2017/3/30.
 */


function getSelectedCodes(accessType){
    var codes = []; 
    var masterType =getQueryStringByDecode('masterType');
    if(masterType!=""){
        var params = {};
        var masterValue =getQueryStringByDecode('masterValue');
        params.search_EQ_masterType = masterType;
        params.search_EQ_masterValue = masterValue;
        params.search_EQ_accessType = accessType;
        $.ajax({
            url : _webApp+'/auth/privilege/manager',
            type:"get",
            async:false,
            data:params,
            dataType: "json",
            success:function(res){
                for(var i = 0 ;i<res.data.length;i++){
                    var row = res.data[i];
                    codes.push(row.accessValue) ;
                }
            }
        });
    }
    return codes;
}
function disableRow(codes,codeAttr,data) {
    if(codes.length>0){
        for(var i = 0;i<codes.length;i++){
            for(var j = 0;j<data.rows.length;j++){
                if(data.rows[j][codeAttr]==codes[i]){
                    var dom = $("input[type='checkbox']")[j + 1];
                    dom.disabled = true;
                    $(dom).attr('checked',true);
                    $(dom).parent().parent().parent().css('background-color','gray');
                }
            }
        }
    }
}